-
-
Notifications
You must be signed in to change notification settings - Fork 770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added NetworkIdentity Spawn Methods & Tests #3201
Added NetworkIdentity Spawn Methods & Tests #3201
Conversation
Added possibly obsolete tests for Spawn using Network Identity Fixed Shutdown_DisabledAllSpawnedPrefabs() using wrong identity
@realQuartzi nice work. |
@vis2k I guess one can do that yea... in reality I guess we are just doing one extra call to save an early |
@vis2k I made some adjustments. I also added extra checks for the GameObject related methods to return the object name in an error log. It might be a little different than what you asked for but this might be better... at least in my thinking, it was. |
28fe97d
to
dfd4d0b
Compare
Added possibly obsolete tests for Spawn using Network Identity Fixed Shutdown_DisabledAllSpawnedPrefabs() using wrong identity
…rtzi/Mirror into feature/IdentitySpawning
I hope this is okay. Got very confused midway. o.o |
I have absolutely no clue why I felt like doing this <3
Adds the option to use NetworkIdentities to spawn Objects instead of the Object itself... sometimes saving a nasty
GetComponent<>
call.SpawnObject(NetworkIdentity identity, NetworkConnection ownerConnection)
Spawn(NetworkIdentity identity, NetworkConnection ownerConnection = null)
Spawn(NetworkIdentity spawnIdentity, GameObject ownerPlayer)
Spawn(NetworkIdentity spawnIdentity, NetworkIdentity ownerIdentity)
Spawn(NetworkIdentity identity, Guid assetId, NetworkConnection ownerConnection = null)
No other functions modified, only new ones added... possibly some obsolete but I guess nice to have.
Hope none of the comments are wrong
Attempted to add Tests with the new Spawn Methods... these are possibly obsolete D:
ServerMode_IsFlags_Identity_Test()
HostMode_IsFlags_Identity_Test()
SpawnNetworkPrefab(GameObject prefab)
As well as fixed on minor issue with a already existing Test method which was using the wrong variable :)
Shutdown_DisablesAllSpawnedPrefabs()
And all tests still work just fine :D